import request from '@/utils/request'

//管理员登录
export const OauthLogin = (data: { name: string; password: string }): Promise<ServiceResponse<Token>> => {return  request({ url: 'accessToken/gettoken', data, loading: true })}
//获取管理员可访问导航列表
export const RoleMenus = (): Promise<ServiceResponse<Menu[]>>  => request({ url: 'role/menus' })
//刷新token
export const RefreshToken = (data: { token: string }): Promise<ServiceResponse<Token>> => request({ url: 'accessToken/refreshToken', data })
//post请求
export const PostList = (url: string, data: any): Promise<ServiceResponse<any>> => request({ url: url, data, method: 'POST' })
//Get请求
export const GetList = (url: string, data: any): Promise<ServiceResponse<any>> => request({ url: url, data, method: 'GET' })
///获取配置
export const GetSetting = (): Promise<ServiceResponse<SiteSetting>> => request({ url: 'setting' })
//保存配置
export const SettingSave = (data:SiteSetting): Promise<ServiceResponse<any>> => request({ url: 'setting', data, method: 'POST' })